Left Termination of the query pattern search_tree_in_1(g) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

search_tree(void).
search_tree(T) :- search_tree(T, X, X1).
search_tree(tree(X, void, void), X, X).
search_tree(tree(X, void, Right), X, Max) :- ','(search_tree(Right, Min, Max), less(X, Min)).
search_tree(tree(X, Left, void), Min, X) :- ','(search_tree(Left, Min, Max), less(Max, X)).
search_tree(tree(X, Left, Right), Min1, Max2) :- ','(search_tree(Left, Min1, Max1), ','(less(Max1, X), ','(search_tree(Right, Min2, Max2), less(X, Min2)))).
less(0, s(X)).
less(s(X), s(Y)) :- less(X, Y).

Queries:

search_tree(g).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

search_tree_in(T) → U1(T, search_tree_in(T, X, X1))
search_tree_in(tree(X, Left, Right), Min1, Max2) → U6(X, Left, Right, Min1, Max2, search_tree_in(Left, Min1, Max1))
search_tree_in(tree(X, Left, void), Min, X) → U4(X, Left, Min, search_tree_in(Left, Min, Max))
search_tree_in(tree(X, void, Right), X, Max) → U2(X, Right, Max, search_tree_in(Right, Min, Max))
search_tree_in(tree(X, void, void), X, X) → search_tree_out(tree(X, void, void), X, X)
U2(X, Right, Max, search_tree_out(Right, Min, Max)) → U3(X, Right, Max, less_in(X, Min))
less_in(s(X), s(Y)) → U10(X, Y, less_in(X, Y))
less_in(0, s(X)) → less_out(0, s(X))
U10(X, Y, less_out(X, Y)) → less_out(s(X), s(Y))
U3(X, Right, Max, less_out(X, Min)) → search_tree_out(tree(X, void, Right), X, Max)
U4(X, Left, Min, search_tree_out(Left, Min, Max)) → U5(X, Left, Min, less_in(Max, X))
U5(X, Left, Min, less_out(Max, X)) → search_tree_out(tree(X, Left, void), Min, X)
U6(X, Left, Right, Min1, Max2, search_tree_out(Left, Min1, Max1)) → U7(X, Left, Right, Min1, Max2, Max1, less_in(Max1, X))
U7(X, Left, Right, Min1, Max2, Max1, less_out(Max1, X)) → U8(X, Left, Right, Min1, Max2, search_tree_in(Right, Min2, Max2))
U8(X, Left, Right, Min1, Max2, search_tree_out(Right, Min2, Max2)) → U9(X, Left, Right, Min1, Max2, less_in(X, Min2))
U9(X, Left, Right, Min1, Max2, less_out(X, Min2)) → search_tree_out(tree(X, Left, Right), Min1, Max2)
U1(T, search_tree_out(T, X, X1)) → search_tree_out(T)
search_tree_in(void) → search_tree_out(void)

The argument filtering Pi contains the following mapping:
search_tree_in(x1)  =  search_tree_in(x1)
U1(x1, x2)  =  U1(x2)
search_tree_in(x1, x2, x3)  =  search_tree_in(x1)
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x3, x6)
void  =  void
U4(x1, x2, x3, x4)  =  U4(x1, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x4)
search_tree_out(x1, x2, x3)  =  search_tree_out(x2, x3)
U3(x1, x2, x3, x4)  =  U3(x1, x3, x4)
less_in(x1, x2)  =  less_in(x1, x2)
s(x1)  =  s(x1)
U10(x1, x2, x3)  =  U10(x3)
0  =  0
less_out(x1, x2)  =  less_out
U5(x1, x2, x3, x4)  =  U5(x1, x3, x4)
U7(x1, x2, x3, x4, x5, x6, x7)  =  U7(x1, x3, x4, x7)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x4, x6)
U9(x1, x2, x3, x4, x5, x6)  =  U9(x4, x5, x6)
search_tree_out(x1)  =  search_tree_out

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

search_tree_in(T) → U1(T, search_tree_in(T, X, X1))
search_tree_in(tree(X, Left, Right), Min1, Max2) → U6(X, Left, Right, Min1, Max2, search_tree_in(Left, Min1, Max1))
search_tree_in(tree(X, Left, void), Min, X) → U4(X, Left, Min, search_tree_in(Left, Min, Max))
search_tree_in(tree(X, void, Right), X, Max) → U2(X, Right, Max, search_tree_in(Right, Min, Max))
search_tree_in(tree(X, void, void), X, X) → search_tree_out(tree(X, void, void), X, X)
U2(X, Right, Max, search_tree_out(Right, Min, Max)) → U3(X, Right, Max, less_in(X, Min))
less_in(s(X), s(Y)) → U10(X, Y, less_in(X, Y))
less_in(0, s(X)) → less_out(0, s(X))
U10(X, Y, less_out(X, Y)) → less_out(s(X), s(Y))
U3(X, Right, Max, less_out(X, Min)) → search_tree_out(tree(X, void, Right), X, Max)
U4(X, Left, Min, search_tree_out(Left, Min, Max)) → U5(X, Left, Min, less_in(Max, X))
U5(X, Left, Min, less_out(Max, X)) → search_tree_out(tree(X, Left, void), Min, X)
U6(X, Left, Right, Min1, Max2, search_tree_out(Left, Min1, Max1)) → U7(X, Left, Right, Min1, Max2, Max1, less_in(Max1, X))
U7(X, Left, Right, Min1, Max2, Max1, less_out(Max1, X)) → U8(X, Left, Right, Min1, Max2, search_tree_in(Right, Min2, Max2))
U8(X, Left, Right, Min1, Max2, search_tree_out(Right, Min2, Max2)) → U9(X, Left, Right, Min1, Max2, less_in(X, Min2))
U9(X, Left, Right, Min1, Max2, less_out(X, Min2)) → search_tree_out(tree(X, Left, Right), Min1, Max2)
U1(T, search_tree_out(T, X, X1)) → search_tree_out(T)
search_tree_in(void) → search_tree_out(void)

The argument filtering Pi contains the following mapping:
search_tree_in(x1)  =  search_tree_in(x1)
U1(x1, x2)  =  U1(x2)
search_tree_in(x1, x2, x3)  =  search_tree_in(x1)
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x3, x6)
void  =  void
U4(x1, x2, x3, x4)  =  U4(x1, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x4)
search_tree_out(x1, x2, x3)  =  search_tree_out(x2, x3)
U3(x1, x2, x3, x4)  =  U3(x1, x3, x4)
less_in(x1, x2)  =  less_in(x1, x2)
s(x1)  =  s(x1)
U10(x1, x2, x3)  =  U10(x3)
0  =  0
less_out(x1, x2)  =  less_out
U5(x1, x2, x3, x4)  =  U5(x1, x3, x4)
U7(x1, x2, x3, x4, x5, x6, x7)  =  U7(x1, x3, x4, x7)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x4, x6)
U9(x1, x2, x3, x4, x5, x6)  =  U9(x4, x5, x6)
search_tree_out(x1)  =  search_tree_out


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

SEARCH_TREE_IN(T) → U11(T, search_tree_in(T, X, X1))
SEARCH_TREE_IN(T) → SEARCH_TREE_IN(T, X, X1)
SEARCH_TREE_IN(tree(X, Left, Right), Min1, Max2) → U61(X, Left, Right, Min1, Max2, search_tree_in(Left, Min1, Max1))
SEARCH_TREE_IN(tree(X, Left, Right), Min1, Max2) → SEARCH_TREE_IN(Left, Min1, Max1)
SEARCH_TREE_IN(tree(X, Left, void), Min, X) → U41(X, Left, Min, search_tree_in(Left, Min, Max))
SEARCH_TREE_IN(tree(X, Left, void), Min, X) → SEARCH_TREE_IN(Left, Min, Max)
SEARCH_TREE_IN(tree(X, void, Right), X, Max) → U21(X, Right, Max, search_tree_in(Right, Min, Max))
SEARCH_TREE_IN(tree(X, void, Right), X, Max) → SEARCH_TREE_IN(Right, Min, Max)
U21(X, Right, Max, search_tree_out(Right, Min, Max)) → U31(X, Right, Max, less_in(X, Min))
U21(X, Right, Max, search_tree_out(Right, Min, Max)) → LESS_IN(X, Min)
LESS_IN(s(X), s(Y)) → U101(X, Y, less_in(X, Y))
LESS_IN(s(X), s(Y)) → LESS_IN(X, Y)
U41(X, Left, Min, search_tree_out(Left, Min, Max)) → U51(X, Left, Min, less_in(Max, X))
U41(X, Left, Min, search_tree_out(Left, Min, Max)) → LESS_IN(Max, X)
U61(X, Left, Right, Min1, Max2, search_tree_out(Left, Min1, Max1)) → U71(X, Left, Right, Min1, Max2, Max1, less_in(Max1, X))
U61(X, Left, Right, Min1, Max2, search_tree_out(Left, Min1, Max1)) → LESS_IN(Max1, X)
U71(X, Left, Right, Min1, Max2, Max1, less_out(Max1, X)) → U81(X, Left, Right, Min1, Max2, search_tree_in(Right, Min2, Max2))
U71(X, Left, Right, Min1, Max2, Max1, less_out(Max1, X)) → SEARCH_TREE_IN(Right, Min2, Max2)
U81(X, Left, Right, Min1, Max2, search_tree_out(Right, Min2, Max2)) → U91(X, Left, Right, Min1, Max2, less_in(X, Min2))
U81(X, Left, Right, Min1, Max2, search_tree_out(Right, Min2, Max2)) → LESS_IN(X, Min2)

The TRS R consists of the following rules:

search_tree_in(T) → U1(T, search_tree_in(T, X, X1))
search_tree_in(tree(X, Left, Right), Min1, Max2) → U6(X, Left, Right, Min1, Max2, search_tree_in(Left, Min1, Max1))
search_tree_in(tree(X, Left, void), Min, X) → U4(X, Left, Min, search_tree_in(Left, Min, Max))
search_tree_in(tree(X, void, Right), X, Max) → U2(X, Right, Max, search_tree_in(Right, Min, Max))
search_tree_in(tree(X, void, void), X, X) → search_tree_out(tree(X, void, void), X, X)
U2(X, Right, Max, search_tree_out(Right, Min, Max)) → U3(X, Right, Max, less_in(X, Min))
less_in(s(X), s(Y)) → U10(X, Y, less_in(X, Y))
less_in(0, s(X)) → less_out(0, s(X))
U10(X, Y, less_out(X, Y)) → less_out(s(X), s(Y))
U3(X, Right, Max, less_out(X, Min)) → search_tree_out(tree(X, void, Right), X, Max)
U4(X, Left, Min, search_tree_out(Left, Min, Max)) → U5(X, Left, Min, less_in(Max, X))
U5(X, Left, Min, less_out(Max, X)) → search_tree_out(tree(X, Left, void), Min, X)
U6(X, Left, Right, Min1, Max2, search_tree_out(Left, Min1, Max1)) → U7(X, Left, Right, Min1, Max2, Max1, less_in(Max1, X))
U7(X, Left, Right, Min1, Max2, Max1, less_out(Max1, X)) → U8(X, Left, Right, Min1, Max2, search_tree_in(Right, Min2, Max2))
U8(X, Left, Right, Min1, Max2, search_tree_out(Right, Min2, Max2)) → U9(X, Left, Right, Min1, Max2, less_in(X, Min2))
U9(X, Left, Right, Min1, Max2, less_out(X, Min2)) → search_tree_out(tree(X, Left, Right), Min1, Max2)
U1(T, search_tree_out(T, X, X1)) → search_tree_out(T)
search_tree_in(void) → search_tree_out(void)

The argument filtering Pi contains the following mapping:
search_tree_in(x1)  =  search_tree_in(x1)
U1(x1, x2)  =  U1(x2)
search_tree_in(x1, x2, x3)  =  search_tree_in(x1)
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x3, x6)
void  =  void
U4(x1, x2, x3, x4)  =  U4(x1, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x4)
search_tree_out(x1, x2, x3)  =  search_tree_out(x2, x3)
U3(x1, x2, x3, x4)  =  U3(x1, x3, x4)
less_in(x1, x2)  =  less_in(x1, x2)
s(x1)  =  s(x1)
U10(x1, x2, x3)  =  U10(x3)
0  =  0
less_out(x1, x2)  =  less_out
U5(x1, x2, x3, x4)  =  U5(x1, x3, x4)
U7(x1, x2, x3, x4, x5, x6, x7)  =  U7(x1, x3, x4, x7)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x4, x6)
U9(x1, x2, x3, x4, x5, x6)  =  U9(x4, x5, x6)
search_tree_out(x1)  =  search_tree_out
U41(x1, x2, x3, x4)  =  U41(x1, x4)
U21(x1, x2, x3, x4)  =  U21(x1, x4)
U81(x1, x2, x3, x4, x5, x6)  =  U81(x1, x4, x6)
SEARCH_TREE_IN(x1)  =  SEARCH_TREE_IN(x1)
SEARCH_TREE_IN(x1, x2, x3)  =  SEARCH_TREE_IN(x1)
LESS_IN(x1, x2)  =  LESS_IN(x1, x2)
U51(x1, x2, x3, x4)  =  U51(x1, x3, x4)
U31(x1, x2, x3, x4)  =  U31(x1, x3, x4)
U101(x1, x2, x3)  =  U101(x3)
U91(x1, x2, x3, x4, x5, x6)  =  U91(x4, x5, x6)
U11(x1, x2)  =  U11(x2)
U71(x1, x2, x3, x4, x5, x6, x7)  =  U71(x1, x3, x4, x7)
U61(x1, x2, x3, x4, x5, x6)  =  U61(x1, x3, x6)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

SEARCH_TREE_IN(T) → U11(T, search_tree_in(T, X, X1))
SEARCH_TREE_IN(T) → SEARCH_TREE_IN(T, X, X1)
SEARCH_TREE_IN(tree(X, Left, Right), Min1, Max2) → U61(X, Left, Right, Min1, Max2, search_tree_in(Left, Min1, Max1))
SEARCH_TREE_IN(tree(X, Left, Right), Min1, Max2) → SEARCH_TREE_IN(Left, Min1, Max1)
SEARCH_TREE_IN(tree(X, Left, void), Min, X) → U41(X, Left, Min, search_tree_in(Left, Min, Max))
SEARCH_TREE_IN(tree(X, Left, void), Min, X) → SEARCH_TREE_IN(Left, Min, Max)
SEARCH_TREE_IN(tree(X, void, Right), X, Max) → U21(X, Right, Max, search_tree_in(Right, Min, Max))
SEARCH_TREE_IN(tree(X, void, Right), X, Max) → SEARCH_TREE_IN(Right, Min, Max)
U21(X, Right, Max, search_tree_out(Right, Min, Max)) → U31(X, Right, Max, less_in(X, Min))
U21(X, Right, Max, search_tree_out(Right, Min, Max)) → LESS_IN(X, Min)
LESS_IN(s(X), s(Y)) → U101(X, Y, less_in(X, Y))
LESS_IN(s(X), s(Y)) → LESS_IN(X, Y)
U41(X, Left, Min, search_tree_out(Left, Min, Max)) → U51(X, Left, Min, less_in(Max, X))
U41(X, Left, Min, search_tree_out(Left, Min, Max)) → LESS_IN(Max, X)
U61(X, Left, Right, Min1, Max2, search_tree_out(Left, Min1, Max1)) → U71(X, Left, Right, Min1, Max2, Max1, less_in(Max1, X))
U61(X, Left, Right, Min1, Max2, search_tree_out(Left, Min1, Max1)) → LESS_IN(Max1, X)
U71(X, Left, Right, Min1, Max2, Max1, less_out(Max1, X)) → U81(X, Left, Right, Min1, Max2, search_tree_in(Right, Min2, Max2))
U71(X, Left, Right, Min1, Max2, Max1, less_out(Max1, X)) → SEARCH_TREE_IN(Right, Min2, Max2)
U81(X, Left, Right, Min1, Max2, search_tree_out(Right, Min2, Max2)) → U91(X, Left, Right, Min1, Max2, less_in(X, Min2))
U81(X, Left, Right, Min1, Max2, search_tree_out(Right, Min2, Max2)) → LESS_IN(X, Min2)

The TRS R consists of the following rules:

search_tree_in(T) → U1(T, search_tree_in(T, X, X1))
search_tree_in(tree(X, Left, Right), Min1, Max2) → U6(X, Left, Right, Min1, Max2, search_tree_in(Left, Min1, Max1))
search_tree_in(tree(X, Left, void), Min, X) → U4(X, Left, Min, search_tree_in(Left, Min, Max))
search_tree_in(tree(X, void, Right), X, Max) → U2(X, Right, Max, search_tree_in(Right, Min, Max))
search_tree_in(tree(X, void, void), X, X) → search_tree_out(tree(X, void, void), X, X)
U2(X, Right, Max, search_tree_out(Right, Min, Max)) → U3(X, Right, Max, less_in(X, Min))
less_in(s(X), s(Y)) → U10(X, Y, less_in(X, Y))
less_in(0, s(X)) → less_out(0, s(X))
U10(X, Y, less_out(X, Y)) → less_out(s(X), s(Y))
U3(X, Right, Max, less_out(X, Min)) → search_tree_out(tree(X, void, Right), X, Max)
U4(X, Left, Min, search_tree_out(Left, Min, Max)) → U5(X, Left, Min, less_in(Max, X))
U5(X, Left, Min, less_out(Max, X)) → search_tree_out(tree(X, Left, void), Min, X)
U6(X, Left, Right, Min1, Max2, search_tree_out(Left, Min1, Max1)) → U7(X, Left, Right, Min1, Max2, Max1, less_in(Max1, X))
U7(X, Left, Right, Min1, Max2, Max1, less_out(Max1, X)) → U8(X, Left, Right, Min1, Max2, search_tree_in(Right, Min2, Max2))
U8(X, Left, Right, Min1, Max2, search_tree_out(Right, Min2, Max2)) → U9(X, Left, Right, Min1, Max2, less_in(X, Min2))
U9(X, Left, Right, Min1, Max2, less_out(X, Min2)) → search_tree_out(tree(X, Left, Right), Min1, Max2)
U1(T, search_tree_out(T, X, X1)) → search_tree_out(T)
search_tree_in(void) → search_tree_out(void)

The argument filtering Pi contains the following mapping:
search_tree_in(x1)  =  search_tree_in(x1)
U1(x1, x2)  =  U1(x2)
search_tree_in(x1, x2, x3)  =  search_tree_in(x1)
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x3, x6)
void  =  void
U4(x1, x2, x3, x4)  =  U4(x1, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x4)
search_tree_out(x1, x2, x3)  =  search_tree_out(x2, x3)
U3(x1, x2, x3, x4)  =  U3(x1, x3, x4)
less_in(x1, x2)  =  less_in(x1, x2)
s(x1)  =  s(x1)
U10(x1, x2, x3)  =  U10(x3)
0  =  0
less_out(x1, x2)  =  less_out
U5(x1, x2, x3, x4)  =  U5(x1, x3, x4)
U7(x1, x2, x3, x4, x5, x6, x7)  =  U7(x1, x3, x4, x7)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x4, x6)
U9(x1, x2, x3, x4, x5, x6)  =  U9(x4, x5, x6)
search_tree_out(x1)  =  search_tree_out
U41(x1, x2, x3, x4)  =  U41(x1, x4)
U21(x1, x2, x3, x4)  =  U21(x1, x4)
U81(x1, x2, x3, x4, x5, x6)  =  U81(x1, x4, x6)
SEARCH_TREE_IN(x1)  =  SEARCH_TREE_IN(x1)
SEARCH_TREE_IN(x1, x2, x3)  =  SEARCH_TREE_IN(x1)
LESS_IN(x1, x2)  =  LESS_IN(x1, x2)
U51(x1, x2, x3, x4)  =  U51(x1, x3, x4)
U31(x1, x2, x3, x4)  =  U31(x1, x3, x4)
U101(x1, x2, x3)  =  U101(x3)
U91(x1, x2, x3, x4, x5, x6)  =  U91(x4, x5, x6)
U11(x1, x2)  =  U11(x2)
U71(x1, x2, x3, x4, x5, x6, x7)  =  U71(x1, x3, x4, x7)
U61(x1, x2, x3, x4, x5, x6)  =  U61(x1, x3, x6)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 13 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LESS_IN(s(X), s(Y)) → LESS_IN(X, Y)

The TRS R consists of the following rules:

search_tree_in(T) → U1(T, search_tree_in(T, X, X1))
search_tree_in(tree(X, Left, Right), Min1, Max2) → U6(X, Left, Right, Min1, Max2, search_tree_in(Left, Min1, Max1))
search_tree_in(tree(X, Left, void), Min, X) → U4(X, Left, Min, search_tree_in(Left, Min, Max))
search_tree_in(tree(X, void, Right), X, Max) → U2(X, Right, Max, search_tree_in(Right, Min, Max))
search_tree_in(tree(X, void, void), X, X) → search_tree_out(tree(X, void, void), X, X)
U2(X, Right, Max, search_tree_out(Right, Min, Max)) → U3(X, Right, Max, less_in(X, Min))
less_in(s(X), s(Y)) → U10(X, Y, less_in(X, Y))
less_in(0, s(X)) → less_out(0, s(X))
U10(X, Y, less_out(X, Y)) → less_out(s(X), s(Y))
U3(X, Right, Max, less_out(X, Min)) → search_tree_out(tree(X, void, Right), X, Max)
U4(X, Left, Min, search_tree_out(Left, Min, Max)) → U5(X, Left, Min, less_in(Max, X))
U5(X, Left, Min, less_out(Max, X)) → search_tree_out(tree(X, Left, void), Min, X)
U6(X, Left, Right, Min1, Max2, search_tree_out(Left, Min1, Max1)) → U7(X, Left, Right, Min1, Max2, Max1, less_in(Max1, X))
U7(X, Left, Right, Min1, Max2, Max1, less_out(Max1, X)) → U8(X, Left, Right, Min1, Max2, search_tree_in(Right, Min2, Max2))
U8(X, Left, Right, Min1, Max2, search_tree_out(Right, Min2, Max2)) → U9(X, Left, Right, Min1, Max2, less_in(X, Min2))
U9(X, Left, Right, Min1, Max2, less_out(X, Min2)) → search_tree_out(tree(X, Left, Right), Min1, Max2)
U1(T, search_tree_out(T, X, X1)) → search_tree_out(T)
search_tree_in(void) → search_tree_out(void)

The argument filtering Pi contains the following mapping:
search_tree_in(x1)  =  search_tree_in(x1)
U1(x1, x2)  =  U1(x2)
search_tree_in(x1, x2, x3)  =  search_tree_in(x1)
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x3, x6)
void  =  void
U4(x1, x2, x3, x4)  =  U4(x1, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x4)
search_tree_out(x1, x2, x3)  =  search_tree_out(x2, x3)
U3(x1, x2, x3, x4)  =  U3(x1, x3, x4)
less_in(x1, x2)  =  less_in(x1, x2)
s(x1)  =  s(x1)
U10(x1, x2, x3)  =  U10(x3)
0  =  0
less_out(x1, x2)  =  less_out
U5(x1, x2, x3, x4)  =  U5(x1, x3, x4)
U7(x1, x2, x3, x4, x5, x6, x7)  =  U7(x1, x3, x4, x7)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x4, x6)
U9(x1, x2, x3, x4, x5, x6)  =  U9(x4, x5, x6)
search_tree_out(x1)  =  search_tree_out
LESS_IN(x1, x2)  =  LESS_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LESS_IN(s(X), s(Y)) → LESS_IN(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

LESS_IN(s(X), s(Y)) → LESS_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

SEARCH_TREE_IN(tree(X, Left, Right), Min1, Max2) → U61(X, Left, Right, Min1, Max2, search_tree_in(Left, Min1, Max1))
U61(X, Left, Right, Min1, Max2, search_tree_out(Left, Min1, Max1)) → U71(X, Left, Right, Min1, Max2, Max1, less_in(Max1, X))
SEARCH_TREE_IN(tree(X, void, Right), X, Max) → SEARCH_TREE_IN(Right, Min, Max)
SEARCH_TREE_IN(tree(X, Left, void), Min, X) → SEARCH_TREE_IN(Left, Min, Max)
U71(X, Left, Right, Min1, Max2, Max1, less_out(Max1, X)) → SEARCH_TREE_IN(Right, Min2, Max2)
SEARCH_TREE_IN(tree(X, Left, Right), Min1, Max2) → SEARCH_TREE_IN(Left, Min1, Max1)

The TRS R consists of the following rules:

search_tree_in(T) → U1(T, search_tree_in(T, X, X1))
search_tree_in(tree(X, Left, Right), Min1, Max2) → U6(X, Left, Right, Min1, Max2, search_tree_in(Left, Min1, Max1))
search_tree_in(tree(X, Left, void), Min, X) → U4(X, Left, Min, search_tree_in(Left, Min, Max))
search_tree_in(tree(X, void, Right), X, Max) → U2(X, Right, Max, search_tree_in(Right, Min, Max))
search_tree_in(tree(X, void, void), X, X) → search_tree_out(tree(X, void, void), X, X)
U2(X, Right, Max, search_tree_out(Right, Min, Max)) → U3(X, Right, Max, less_in(X, Min))
less_in(s(X), s(Y)) → U10(X, Y, less_in(X, Y))
less_in(0, s(X)) → less_out(0, s(X))
U10(X, Y, less_out(X, Y)) → less_out(s(X), s(Y))
U3(X, Right, Max, less_out(X, Min)) → search_tree_out(tree(X, void, Right), X, Max)
U4(X, Left, Min, search_tree_out(Left, Min, Max)) → U5(X, Left, Min, less_in(Max, X))
U5(X, Left, Min, less_out(Max, X)) → search_tree_out(tree(X, Left, void), Min, X)
U6(X, Left, Right, Min1, Max2, search_tree_out(Left, Min1, Max1)) → U7(X, Left, Right, Min1, Max2, Max1, less_in(Max1, X))
U7(X, Left, Right, Min1, Max2, Max1, less_out(Max1, X)) → U8(X, Left, Right, Min1, Max2, search_tree_in(Right, Min2, Max2))
U8(X, Left, Right, Min1, Max2, search_tree_out(Right, Min2, Max2)) → U9(X, Left, Right, Min1, Max2, less_in(X, Min2))
U9(X, Left, Right, Min1, Max2, less_out(X, Min2)) → search_tree_out(tree(X, Left, Right), Min1, Max2)
U1(T, search_tree_out(T, X, X1)) → search_tree_out(T)
search_tree_in(void) → search_tree_out(void)

The argument filtering Pi contains the following mapping:
search_tree_in(x1)  =  search_tree_in(x1)
U1(x1, x2)  =  U1(x2)
search_tree_in(x1, x2, x3)  =  search_tree_in(x1)
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x3, x6)
void  =  void
U4(x1, x2, x3, x4)  =  U4(x1, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x4)
search_tree_out(x1, x2, x3)  =  search_tree_out(x2, x3)
U3(x1, x2, x3, x4)  =  U3(x1, x3, x4)
less_in(x1, x2)  =  less_in(x1, x2)
s(x1)  =  s(x1)
U10(x1, x2, x3)  =  U10(x3)
0  =  0
less_out(x1, x2)  =  less_out
U5(x1, x2, x3, x4)  =  U5(x1, x3, x4)
U7(x1, x2, x3, x4, x5, x6, x7)  =  U7(x1, x3, x4, x7)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x4, x6)
U9(x1, x2, x3, x4, x5, x6)  =  U9(x4, x5, x6)
search_tree_out(x1)  =  search_tree_out
SEARCH_TREE_IN(x1, x2, x3)  =  SEARCH_TREE_IN(x1)
U71(x1, x2, x3, x4, x5, x6, x7)  =  U71(x1, x3, x4, x7)
U61(x1, x2, x3, x4, x5, x6)  =  U61(x1, x3, x6)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

SEARCH_TREE_IN(tree(X, Left, Right), Min1, Max2) → U61(X, Left, Right, Min1, Max2, search_tree_in(Left, Min1, Max1))
U61(X, Left, Right, Min1, Max2, search_tree_out(Left, Min1, Max1)) → U71(X, Left, Right, Min1, Max2, Max1, less_in(Max1, X))
SEARCH_TREE_IN(tree(X, void, Right), X, Max) → SEARCH_TREE_IN(Right, Min, Max)
SEARCH_TREE_IN(tree(X, Left, void), Min, X) → SEARCH_TREE_IN(Left, Min, Max)
U71(X, Left, Right, Min1, Max2, Max1, less_out(Max1, X)) → SEARCH_TREE_IN(Right, Min2, Max2)
SEARCH_TREE_IN(tree(X, Left, Right), Min1, Max2) → SEARCH_TREE_IN(Left, Min1, Max1)

The TRS R consists of the following rules:

search_tree_in(tree(X, Left, Right), Min1, Max2) → U6(X, Left, Right, Min1, Max2, search_tree_in(Left, Min1, Max1))
search_tree_in(tree(X, Left, void), Min, X) → U4(X, Left, Min, search_tree_in(Left, Min, Max))
search_tree_in(tree(X, void, Right), X, Max) → U2(X, Right, Max, search_tree_in(Right, Min, Max))
search_tree_in(tree(X, void, void), X, X) → search_tree_out(tree(X, void, void), X, X)
less_in(s(X), s(Y)) → U10(X, Y, less_in(X, Y))
less_in(0, s(X)) → less_out(0, s(X))
U6(X, Left, Right, Min1, Max2, search_tree_out(Left, Min1, Max1)) → U7(X, Left, Right, Min1, Max2, Max1, less_in(Max1, X))
U4(X, Left, Min, search_tree_out(Left, Min, Max)) → U5(X, Left, Min, less_in(Max, X))
U2(X, Right, Max, search_tree_out(Right, Min, Max)) → U3(X, Right, Max, less_in(X, Min))
U10(X, Y, less_out(X, Y)) → less_out(s(X), s(Y))
U7(X, Left, Right, Min1, Max2, Max1, less_out(Max1, X)) → U8(X, Left, Right, Min1, Max2, search_tree_in(Right, Min2, Max2))
U5(X, Left, Min, less_out(Max, X)) → search_tree_out(tree(X, Left, void), Min, X)
U3(X, Right, Max, less_out(X, Min)) → search_tree_out(tree(X, void, Right), X, Max)
U8(X, Left, Right, Min1, Max2, search_tree_out(Right, Min2, Max2)) → U9(X, Left, Right, Min1, Max2, less_in(X, Min2))
U9(X, Left, Right, Min1, Max2, less_out(X, Min2)) → search_tree_out(tree(X, Left, Right), Min1, Max2)

The argument filtering Pi contains the following mapping:
search_tree_in(x1, x2, x3)  =  search_tree_in(x1)
tree(x1, x2, x3)  =  tree(x1, x2, x3)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x3, x6)
void  =  void
U4(x1, x2, x3, x4)  =  U4(x1, x4)
U2(x1, x2, x3, x4)  =  U2(x1, x4)
search_tree_out(x1, x2, x3)  =  search_tree_out(x2, x3)
U3(x1, x2, x3, x4)  =  U3(x1, x3, x4)
less_in(x1, x2)  =  less_in(x1, x2)
s(x1)  =  s(x1)
U10(x1, x2, x3)  =  U10(x3)
0  =  0
less_out(x1, x2)  =  less_out
U5(x1, x2, x3, x4)  =  U5(x1, x3, x4)
U7(x1, x2, x3, x4, x5, x6, x7)  =  U7(x1, x3, x4, x7)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x4, x6)
U9(x1, x2, x3, x4, x5, x6)  =  U9(x4, x5, x6)
SEARCH_TREE_IN(x1, x2, x3)  =  SEARCH_TREE_IN(x1)
U71(x1, x2, x3, x4, x5, x6, x7)  =  U71(x1, x3, x4, x7)
U61(x1, x2, x3, x4, x5, x6)  =  U61(x1, x3, x6)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

U71(X, Right, Min1, less_out) → SEARCH_TREE_IN(Right)
SEARCH_TREE_IN(tree(X, Left, void)) → SEARCH_TREE_IN(Left)
SEARCH_TREE_IN(tree(X, void, Right)) → SEARCH_TREE_IN(Right)
SEARCH_TREE_IN(tree(X, Left, Right)) → U61(X, Right, search_tree_in(Left))
SEARCH_TREE_IN(tree(X, Left, Right)) → SEARCH_TREE_IN(Left)
U61(X, Right, search_tree_out(Min1, Max1)) → U71(X, Right, Min1, less_in(Max1, X))

The TRS R consists of the following rules:

search_tree_in(tree(X, Left, Right)) → U6(X, Right, search_tree_in(Left))
search_tree_in(tree(X, Left, void)) → U4(X, search_tree_in(Left))
search_tree_in(tree(X, void, Right)) → U2(X, search_tree_in(Right))
search_tree_in(tree(X, void, void)) → search_tree_out(X, X)
less_in(s(X), s(Y)) → U10(less_in(X, Y))
less_in(0, s(X)) → less_out
U6(X, Right, search_tree_out(Min1, Max1)) → U7(X, Right, Min1, less_in(Max1, X))
U4(X, search_tree_out(Min, Max)) → U5(X, Min, less_in(Max, X))
U2(X, search_tree_out(Min, Max)) → U3(X, Max, less_in(X, Min))
U10(less_out) → less_out
U7(X, Right, Min1, less_out) → U8(X, Min1, search_tree_in(Right))
U5(X, Min, less_out) → search_tree_out(Min, X)
U3(X, Max, less_out) → search_tree_out(X, Max)
U8(X, Min1, search_tree_out(Min2, Max2)) → U9(Min1, Max2, less_in(X, Min2))
U9(Min1, Max2, less_out) → search_tree_out(Min1, Max2)

The set Q consists of the following terms:

search_tree_in(x0)
less_in(x0, x1)
U6(x0, x1, x2)
U4(x0, x1)
U2(x0, x1)
U10(x0)
U7(x0, x1, x2, x3)
U5(x0, x1, x2)
U3(x0, x1, x2)
U8(x0, x1, x2)
U9(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: